using System;

namespace InfoJetSoft.Service.Util
{
	/// <summary>
	/// Summary description for SchemaType.
	/// </summary>
	class SchemaType
	{
		
		public string Type 
		{
			get 
			{
				return type;
			}
			
			set 
			{
				this.type = value;
			}
		}

		public string Nillable 
		{
			get 
			{
				return nillable;
			}
			
			set 
			{
				this.nillable = value;
			}
		}

		public string MinLength 
		{
			get 
			{
				return minLength;
			}
			
			set 
			{
				this.minLength = value;
			}
		}

		public string MaxLength 
		{
			get 
			{
				return maxLength;
			}
			
			set 
			{
				this.maxLength = value;
			}
		}

		public string MinInclusive 
		{
			get 
			{
				return minInclusive;
			}
			
			set 
			{
				this.minInclusive = value;
			}
		}

		public string MaxInclusive 
		{
			get 
			{
				return maxInclusive;
			}
			
			set 
			{
				this.maxInclusive = value;
			}
		}

		private string type = null;
		private string nillable = SchemaType.false_value;
		private string minLength = null;
		private string maxLength = null;
		private string minInclusive = null;
		private string maxInclusive = null;

		public static string _string = "string";
		public static string _int = "int";
		public static string _integer = "integer";
		public static string _double = "double";
		//CID 0155 //2008.11.20 //Begin
		public static string _decimal = "decimal";
		public static string _float = "float";
		//CID 0155 //2008.11.20 //End
		public static string _boolean = "boolean";
		public static string _anyURI = "anyURI";
		public static string _date = "date";
		public static string _time = "time";
		public static string _dateTime = "dateTime";
		public static string _any = "any";
		public static string _base64Binary = "base64Binary";
		public static string _unknown = "unknown";

		//CID 0500 //2010.01.22 //Begin
		public static string[] SimpleTypes = { _string, _double, _date, _integer, _int, _decimal, _float, _boolean, _anyURI, _time, _dateTime };
		//CID 0500 //2010.01.22 //End

		public static string optional_int = "optional_int";
		public static string optional_short = "optional_short";
		public static string optional_decimal = "optional_decimal";
		public static string optional_double = "optional_double";
		public static string optional_Boolean = "optional_Boolean";
		public static string optional_dateTime_notz = "optional_dateTime.notz";
		public static string dateTime_notz = "dateTime.notz";

		public static string true_value = "true";
		public static string false_value = "false";

		public static SchemaType createOptionalInt()
		{
			SchemaType schemaType = new SchemaType();
			schemaType.Type = _integer;
			schemaType.Nillable = SchemaType.true_value;
			return schemaType;
		}

		public static SchemaType createOptionalDouble()
		{
			SchemaType schemaType = new SchemaType();
			schemaType.Type = _double;
			schemaType.Nillable = SchemaType.true_value;
			return schemaType;
		}

		public static SchemaType createOptionalBoolean()
		{
			SchemaType schemaType = new SchemaType();
			schemaType.Type = _boolean;
			schemaType.Nillable = SchemaType.true_value;
			return schemaType;
		}

		public static SchemaType createOptionalDateTimeNotz()
		{
			SchemaType schemaType = new SchemaType();
			schemaType.Type = _dateTime;
			schemaType.Nillable = SchemaType.true_value;
			return schemaType;
		}

		public static SchemaType createDateTimeNotz()
		{
			SchemaType schemaType = new SchemaType();
			schemaType.Type = _dateTime; 
			schemaType.Nillable = SchemaType.false_value;
			return schemaType;
		}

		public static SchemaType createUnknownType()
		{
			SchemaType schemaType = new SchemaType();
			schemaType.Type = _unknown;
			return schemaType;
		}

		public static SchemaType createAnyType()
		{
			SchemaType schemaType = new SchemaType();
			schemaType.Type = _any;
			schemaType.Nillable = SchemaType.true_value;
			return schemaType;
		}

	}
}
